#include <Node.hpp>

Modeling::Node::~Node()
{
	for (unsigned int i=0 ; i<this->getMatricesQty() ; i++)
		delete this->matrix[i];
	this->matrix.clear();
}

Modeling::Node::Node()
{}

Modeling::Node::Node(std::string name)
{
	this->name = name;
}

std::string Modeling::Node::getName()
{
	return this->name;
}

void Modeling::Node::setName(std::string name)
{
	this->name = name;
}

unsigned int Modeling::Node::getChildrenQty()
{
	return this->child.size();
}

void Modeling::Node::addChild(Node* node)
{
	this->child.push_back(node);
}

Modeling::Node* Modeling::Node::getChild(unsigned int index)
{
	return this->child[index];
}

Mathing::Matrix4f* Modeling::Node::getMatrix(unsigned int index)
{
	return this->matrix[index];
}

Mathing::Matrix4f* Modeling::Node::addMatrix(Mathing::Matrix4f matrix)
{
	Mathing::Matrix4f* mat = new Mathing::Matrix4f(matrix);
	this->matrix.push_back(mat);
	return mat;
}

unsigned int Modeling::Node::getMatricesQty()
{
	return this->matrix.size();
}
